<?php

namespace app\api\validate;

use think\Validate;

class SystemArticle extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'id'  =>  'require|integer|gt:0|in:1,2,3,4',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'id.require'  =>  '請求參數不能為空',
        'id.integer'  =>   '請求參數類型錯誤',
        'id.gt'  =>   '請求參數類型錯誤',
        'id.in'  =>   '請求參數類型錯誤',
        // 'code.number'  =>   '编码必须是数字',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['name','type','code'],
        'info'  => ['id'],
        'edit' => [],
    ];
    
}
